Option Explicit On Option Strict On Public Class Form1 Inherits System.Windows.Forms.Form Dim songsRated(100) As String Dim ratings(100) As Integer Dim songNum As Integer #Region " Windows Form Designer generated code " THIS GENERATED CODE REMOVED FOR WWW DISPLAY THIS CODE REMOVED SO AS TO NOT GIVE AWAY ASSIGNMENT THAT WAS DUE 4/1 Private Sub BtnRead_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnRead.Click Dim input As IO.StreamReader If IO.File.Exists("results.txt") Then input = IO.File.OpenText("results.txt") Do While input.Peek <> -1 And songNum <= 100 Dim curr As String curr = input.ReadLine() Dim commapos As Integer commapos = curr.IndexOf(",") songsRated(songNum) = curr.Substring(0, commapos) ratings(songNum) = Convert.ToInt32(curr.Substring(commapos + 1)) songNum = songNum + 1 Loop End If ' artifically show all elements of the array Dim cnt As Integer Dim results As String = "" For cnt = 0 To songNum - 1 results = results & songsRated(cnt) & " Rated: " & ratings(cnt) & Environment.NewLine 'MsgBox(songsRated(cnt) & " Rated: " & ratings(cnt)) Next cnt MsgBox(results) End Sub Private Sub btnShowHigh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowHigh.Click Dim cnt As Integer For cnt = 0 To songNum - 1 If ratings(cnt) >= 4 Then MsgBox(songsRated(cnt) & " Rated: " & ratings(cnt)) End If Next cnt End Sub Private Sub btnAve_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAve.Click Dim total As Integer Dim cnt As Integer For cnt = 0 To songNum - 1 total = total + ratings(cnt) Next cnt Dim ave As Double ave = total / cnt MsgBox("ave rating is: " & ave.ToString("n2")) End Sub End Class